#ifndef __SIDCFUNC_H__
#define __SIDCFUNC_H__
#include "sidcinit.h"
#include "sidcptp.h"
//used in intr
//UINT32 SIDC_FUNC_GetFileNode(UINT32 handle,PSIDC_FILE_NODE pNode);

void SIDC_FUNC_DRAMSetStartAddr(UINT32 DRAMAddr, UINT8 Read);
void SIDC_FUNC_DRAMReadWord(UINT8 *LowByteData, UINT8 *HighByteData);
void SIDC_FUNC_DRAMWriteWord(UINT8 LowByteData, UINT8 HighByteData);

void SIDC_FUNC_SramToUsb(UINT8 xdata* point,UINT16 size);
void SIDC_FUNC_UsbToDram(UINT32 addr,UINT16 size);
UINT16 SIDC_FUNC_UsbToSram(UINT8 xdata* pData,UINT16 size);
//void SIDC_FUNC_UsbToSram(UINT8 xdata* point,UINT16 size);

void SIDC_FUNC_DramToSram(UINT8 xdata *pData, UINT32 addr,UINT16 size);
void SIDC_FUNC_SramToDram(UINT8 xdata *pData, UINT32 addr,UINT16 size);

void SIDC_FUNC_BuildContainer(UINT8 xdata *pData, UINT32 size);
//void SIDC_FUNC_BuildContainer(UINT32 size);


//used in main
UINT32 SIDC_MAIN_GetFileNode(UINT32 handle,PSIDC_FILE_NODE pNode);

UINT8 SIDC_MAIN_DRAMSetStartAddr(UINT32 DRAMAddr, UINT8 Read);
UINT8 SIDC_MAIN_DRAMReadWord(UINT8 *LowByteData, UINT8 *HighByteData);
UINT8 SIDC_MAIN_DRAMWriteWord(UINT8 LowByteData, UINT8 HighByteData);

void SIDC_MAIN_SramToUsb(UINT8 xdata* point,UINT16 size);
UINT16 SIDC_MAIN_UsbToSram(UINT8 xdata* pData,UINT16 size);
void SIDC_MAIN_DramToUsb(UINT32 DramAddr,UINT32 size);
UINT8 SIDC_MAIN_SramToUsb_Intr(UINT8 xdata* point,UINT16 size);

void SIDC_MAIN_DramToSram(UINT8 xdata *pData, UINT32 addr,UINT16 size);
void SIDC_MAIN_SramToDram(UINT8 xdata *pData, UINT32 addr,UINT16 size);

void SIDC_MAIN_BuildContainer(UINT8 xdata *pData, UINT32 size);
//void SIDC_MAIN_BuildContainer(UINT32 size);
//UINT8 SIDC_MAIN_LoadFileFromHandle(UINT32 handle,UINT32 dramAddr,UINT32 loadSize,UINT8* pOutFilePath,UINT32 *pOutFileSize,UINT32 *pOutFileType);
//#define SIDC_MAIN_ParsingPath(pFilePath)	 ((UINT8*)(pFilePath + (strlen(pFilePath) - (8+3+1))))
//#define SIDC_MAIN_GetFileTypeFromHandle(handle)	((handle>=DPS_MASK_HAND)?K_PIMAOBJ_Script: K_PIMAOBJ_EXIF_JPEG)
//#define SIDC_MAIN_CheckIsJpg(handle)	 (SIDC_MAIN_GetFileTypeFromHandle(handle)==K_PIMAOBJ_EXIF_JPEG)
//#define SIDC_MAIN_CheckIsScript(handle)	 (SIDC_MAIN_GetFileTypeFromHandle(handle)==K_PIMAOBJ_Script)

#endif
